<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('学区列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								学区名称：<input type="text" name="schoolName"/>
							</li>

					

							

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="goodsAdd()" shiro:hasPermission="School:school:add">
					<i class="fa fa-plus"></i> 添加学区
				</a>
				
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('School:school:edit')}]];
        var removeFlag = [[${@permission.hasPermi('School:school:remove')}]];
        var prefix = ctx + "School/school";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "学区",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : 'id',
					visible: false
				},
				{
					field : 'schoolName', 
					title : '学区名称',
					sortable: true
				},
				{
					field : 'schoolAddress', 
					title : '学校地址',
					sortable: true
				},
				{
					field : 'tel', 
					title : '学校电话',
					sortable: true
				},
				
			
				{
					field : 'province', 
					title : '省',
					sortable: true
				},
				{
					field : 'city', 
					title : '市',
					sortable: true
				},
				{
					field : 'area', 
					title : '区',
					sortable: true
				},
				{
					field : 'startFee', 
					title : '校区配送费',
					sortable: true
				},
			
				{
					field : 'creactDate', 
					title : '创建时间',
					sortable: false
				},

		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="goodsUpdate(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑学区</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除学区</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        
        function goodsUpdate(id) {
        	$.modal.open('编辑学区', prefix + "/edit/" + id, '1300', '800');			
		}
        
        function goodsAdd() {
        	$.modal.open('添加学区', prefix + "/add/", '1300', '800');			
		}
    </script>
</body>
</html>